#ifndef HAPTICDV_H
#define HAPTICDV_H

#include "dhdc.h"
#include <mutex>
#include <vector>
#include <QString>


class HapticDV
{
public:
    HapticDV();
    ~HapticDV();

    void VerifyForceLimit(double input_force[], std::vector<double> & output);
    void SetForce(double x, double y, double z);
    std::vector<double> GetHapticData();
    std::vector<double> GetHapticSpeed();
    std::vector<double> GetHapticForce();
    bool setHapticForce(std::vector<double> vec);
    void setforcefactor(double fact);
    void setZeroForce(std::vector<double> vec);
    void setMaxfactor(double fact);

private:
    QString GetsdkVesion();
    void SetForceLimit(double x,double y,double z);
private:
    float loop_rate_;
    int device_count_;
    int dev_id_;
    bool set_force_;
    bool keep_alive_=false;
    bool device_enabled_=false;
    std::mutex val_lock_;
    bool force_released_;
    double position_[3];
    double orientation_[3];
    double gripper_angle_;
    double force_x_limit_;
    double force_y_limit_;
    double force_z_limit_;
    std::vector<double> force_;
    double forcefactor_=0;//力矩系数
    std::vector<double> zeroforce_;//零点校准


};

#endif // HAPTICDV_H
